﻿<UserControl x:Class="SQLDeploymentBuilder.UI.Controls.Connections.Editors.AddTypeBox"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:connections="clr-namespace:SQLDeployAnything.Data.Environment;assembly=SQLDeployAnything.Data"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.Resources>
        <ObjectDataProvider x:Key="ConnectionTypes"
                            ObjectType="{x:Type connections:Connection}"
                            MethodName="AvailableConnectionTypes"/>
    </UserControl.Resources>
    <Grid x:Name="AddTypeOfBox" >
        <!--Visibility="Collapsed">-->
        <StackPanel Orientation="Vertical" Margin="4">
            <Label Content="Select Connection Type to Add:"/>
            <ComboBox Name="cmb_ConnectionType" ItemsSource="{Binding Source={StaticResource ConnectionTypes}}"
                          DisplayMemberPath="Name"/>
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="4">
                <Button Content="Create" Margin="4" Command="{Binding AddConnection}" CommandParameter="{Binding SelectedItem, ElementName=cmb_ConnectionType}"/>
                <Button Content="Cancel" Margin="4" Click="Cancel_Click"/>
            </StackPanel>
        </StackPanel>
    </Grid>
</UserControl>
